package com.quz.jn_travel.controller;

import com.quz.jn_travel.pojo.Banner;
import com.quz.jn_travel.pojo.VO.JsonResult;
import com.quz.jn_travel.service.BannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@Api("banner图相关的api")
@RequestMapping("/banner")
public class BannerController {
    @Resource
    BannerService bannerService;

    @GetMapping("/getShowBanner")
    @ApiOperation("拿到banner图")
    @ResponseBody
    public JsonResult getAllBanner() {
        List<Banner> banner = bannerService.getShowBanner();
        JsonResult jsonResult = new JsonResult(banner);
        return jsonResult;
    }
}
